﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Common;
using DataAccessClasses;
namespace mobliebo
{
   public  class Prizes
    {
       iDAC DAC = DACFactory.GetDAC();
       private long _customer_id = -99;
       private long _offer_code = -99;
       private long _prize_id = -99;
       private long _amount = -99;
       private bool _is_deleted = false;
       public bool is_deleted
       {
           get
           {
               return _is_deleted;
           }
           set{
               _is_deleted=value;
           }
    }public long customer_id
       {
           get
           {
               return _customer_id;
           }
           set{
               _customer_id=value;
           }
    }
       public long offer_code
       {
           get
           {
               return _offer_code  ;
           }
           set{
             _offer_code=value;
           }
    }public long prize_id
       {
           get
           {
               return _prize_id;
           }
           set
           {
              _prize_id=value;
           }
    }public long amount
       {
           get
           {
               return _amount;
           }
           set
           {
               _amount=value;
           }
    }

public long SaveRecords()
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@customer_id",customer_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@offer_code", offer_code, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@prizes_id", prize_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@amount", amount, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam4 = DAC.Parameter("@is_deleted", is_deleted, DbType.Boolean, ParameterDirection.Input);
                 DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam2, dbparam3, dbparam4 };
                return DAC.Save("Prizes_save", dbparamcall);
            }
            catch (Exception ex)
            {
                long result = -99;
            }
            return -99;
        }
        public DataTable GetRecords( long customer_id,long offer_code, long prizes_id, long amount,  bool is_deleted, string andor)
        {
            try
            {
                DbParameter dbparam0 = DAC.Parameter("@customer_id", customer_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam1 = DAC.Parameter("@offer_code", offer_code, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam2 = DAC.Parameter("@prizes_id", prize_id, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam3 = DAC.Parameter("@amount", amount, DbType.Int64, ParameterDirection.Input);
                DbParameter dbparam4 = DAC.Parameter("@is_deleted", is_deleted, DbType.Boolean, ParameterDirection.Input);
                DbParameter dbparam5 = DAC.Parameter("@andor", andor, DbType.AnsiString, ParameterDirection.Input);
                DbParameter[] dbparamcall = new DbParameter[] { dbparam0, dbparam1, dbparam2, dbparam3, dbparam4, dbparam5 };
                return DAC.Select("Prizes_get", dbparamcall);
               DataTable dt1 = DAC.Select("Prizes_get", dbparamcall);
                return dt1;
            }
            catch (Exception ex)
            {
                long result = -99;
            }
            return null;
        }
    }
}


  



